﻿using System;
using System.Windows.Data;

namespace BizControl.Presentation.ActivityEditModule.Converters
{
  public class ActivityQualityToDecimalConverter : IValueConverter
  {
    #region IValueConverter Members

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      if (value == null) return default(Decimal);
      return Decimal.Parse(value.ToString());
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      if (value == null) return null;
      return int.Parse(value.ToString());
    }

    #endregion
  }
}
